﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;

namespace MxTol.Models
{
    /// <summary>
    /// 会计基础多选题题库实体类
    /// </summary>
    [ActiveRecord(Table = "[Ba_Multiple]")]
    public class BaMultiple:ActiveRecordBase
    {
        /// <summary>
        /// 题目主键
        /// </summary>
        [PrimaryKey("id")]
        public Guid ID { get; set; }

        /// <summary>
        /// 题目标题
        /// </summary>
        [Property("title")]
        public string Title { get; set; }

        /// <summary>
        /// 答案A
        /// </summary>
        [Property("answer_a")]
        public string A { get; set; }

        /// <summary>
        /// 答案B
        /// </summary>
        [Property("answer_b")]
        public string B { get; set; }

        /// <summary>
        /// 答案C
        /// </summary>
        [Property("answer_c")]
        public string C { get; set; }

        /// <summary>
        /// 答案D
        /// </summary>
        [Property("answer_d")]
        public string D { get; set; }

        /// <summary>
        /// 正确答案，例如：A,B,C
        /// </summary>
        [Property("answer_key")]
        public string Answer { get; set; }

        /// <summary>
        /// 答案解析 没有则表示：略
        /// </summary>
        [Property("analysis")]
        public string Analysis { get; set; }

        /// <summary>
        /// 题目添加入
        /// </summary>
        [Property("add_person")]
        public string AddPerson { get; set; }

        /// <summary>
        /// 该条记录添加时间
        /// </summary>
        [Property("add_time")]
        public DateTime AddTime { get; set; }

        /// <summary>
        /// 根据主键获取多选题
        /// </summary>
        public static BaMultiple GetMultipleByID(Guid id)
        {
            BaMultiple multiple = (BaMultiple)FindByPrimaryKey(typeof(BaMultiple), id);
            if (multiple != null)
            {
                return multiple;
            }
            else
            {
                return null;
            }
        }
    }
}
